home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: 500 MB Amiga Software / 500 MB Amiga Software - Euber 130 - Amiga Games Disc & Mag.iso / userbox / publicdomain / kingfisher2 / locktest.kfrx < prev    next >
Text File  |  1995-03-07  |  2KB  |  61 lines

  1. /* ARexx example for RexxFisher:
  2.  *
  3.  * Run this program while KFServer AND RexxFisher are running.
  4.  * I'M MAKING NO EFFORT TO ASSURE THAT THESE TWO ARE AVAILABLE.
  5.  *
  6.  * Written by:  Udo Schuermann
  7.  * $VER: LockDemo 1.0 (1.3.95)
  8.  *
  9.  * Demonstrates how to lock/unlock KingFisher.  This is useful
  10.  * if you temporarily ADDRESS a different program and do not
  11.  * wish to run the risk of another program using the vacated
  12.  * port and messing us up when we return.
  13.  *
  14.  * The important thing to remember is to ALWAYS CALL RF_UNLOCK!!!
  15.  *
  16.  * NOTE: This script requires RexxFisher 1.10 for two reasons:
  17.  *       1. RF_LOCK/RF_UNLOCK commands
  18.  *       2. The RF_ prefixes are omitted here; this is optional
  19.  *          beginning with RexxFisher 1.10.
  20.  */
  21. options results
  22. address rexxfisher1
  23.  
  24. VERSION
  25. say "Hi, you are now connected to ..." result
  26.  
  27. HELP
  28. say ""
  29. say "Here is some HELP for you, information on RexxFisher in other words:"
  30. say ""
  31. say result
  32.  
  33. say "We now lock RexxFisher..."
  34. LOCK
  35. key = result
  36.  
  37. /* As RexxFisher is now locked against "foreign" use, we could now ADDRESS
  38.  * another program, and later come back.  Just so we know what happens,
  39.  * however, when a program now tries to use this REXXFISHER1 port (even we
  40.  * ourselves) let's just try to get a version string from RexxFisher:
  41.  */
  42. say "Let's get a version inquiry..."
  43. VERSION
  44. say result
  45. /* You will notice that:
  46.  *    a) RexxFisher returned us an error code (which we don't check here,
  47.  *       but should, in this case)
  48.  *    b) 'result' contains, therefore, not a Style Guide compliant version
  49.  *       string, but an error message which we print out
  50.  */
  51.  
  52. say "Let's unlock RexxFisher again, using our key" key
  53. UNLOCK key
  54. say result
  55.  
  56. say "And NOW get a version inquiry..."
  57. VERSION
  58. say result
  59.  
  60. say "Done.  Bye-bye!"
  61.